#ifndef RTS_SERVER_HPP
#define RTS_SERVER_HPP

#include "boost_sockets_server/web_socket_server.hpp"
#include "rts_room.hpp"
#include "game.hpp"

#include <thread>

class rts_server :
    public web_socket_server
{
public:
    rts_server(boost::asio::io_service& io_service,
               int port,
               boost::shared_ptr<logger> log,
               boost::shared_ptr<client_factory> factory,
               const std::string& origin,
               const std::string& location,
               boost::shared_ptr<message_receiver> receiver);

    void start_game(std::vector<boost::shared_ptr<rts_client> >& players);

private:
    std::vector<boost::shared_ptr<game> > _games;

    void game_over(game_ptr g);
};

#endif // RTS_SERVER_HPP
